#!/bin/bash

BONNMOTION="/local/jist-swans-1.0.6"
PACKAGE="edu.bonn.cs.iv.bonnmotion"
CLASSPATH="/local/jist-swans-1.0.6/src"
JAVAPATH="/opt/jdk1.5.0_15/bin"
DOCPATH="/local/jist-swans-1.0.6/src/javadoc"
JAVA="$JAVAPATH/java"
JAVAC="$JAVAPATH/javac"
JAVADOC="$JAVAPATH/javadoc"

cd $BONNMOTION/src
test ! -d easim/ && mkdir easim
for i in `find . -name "*.java"`; do
	DIR=`dirname $i`
	BASE=`basename $i`
	CLASSFILE=easim/$DIR/${BASE%%.*}.class
	if [ \( "$1" = "all" \) -o \( ! -e $CLASSFILE \) -o \( $i -nt $CLASSFILE \) ]
	then
		echo -n Compiling $BASE ...
		$JAVAC -d ../classes -sourcepath . -classpath "$CLASSPATH" $i
		echo " done."
	fi
done
